home *** CD-ROM | disk | FTP | other *** search
- Path: sage.cgd.ucar.edu!jadams
- From: jadams@sage.cgd.ucar.edu (James Adams)
- Newsgroups: comp.lang.c
- Subject: system() & error detection
- Date: 26 Feb 1996 19:36:48 GMT
- Organization: National Center for Atmospheric Research
- Distribution: world
- Message-ID: <4gt24g$dba@ncar.ucar.edu>
- Reply-To: jadams@sage.cgd.ucar.edu
- NNTP-Posting-Host: sage.cgd.ucar.edu
-
- Hello,
-
- I am attempting to use the system() call in order to have a
- user-specified command execute in my program.
-
- I am wondering how I can check whether or not the command has
- completed successfully ? I don't want the program to continue if the
- call I make from system() produces some sort of error. I'd like to be
- able to do something like the following:
-
- result = system(command);
- if (result == ERROR)
- exit(0);
-
- Is there anyway to do this ? Should I be using something other than
- system() ?
-
-
- Thanks for any suggestions !
-
-
- -James
- --
- ---------------------------------------------------------------------------
- James Adams Email: jadams@ucar.edu
- National Center for Atmospheric Research Phone: (303) 497-1356
- Boulder, Colorado Fax: (303) 497-1348
-
- WWW: http://www.cgd.ucar.edu/ccr/jadams/home.html
-